export function isPromise(value) {
  if (value !== null && typeof value === 'object') {
    return value.promise && typeof value.promise.then === 'function';
  }
}

export function getCookie(name) {
  var value = "; " + document.cookie;
  var parts = value.split("; " + name + "=");
  if (parts.length == 2) return parts.pop().split(";").shift();
}

export function setItem(name,params) {
  localStorage.setItem(name, JSON.stringify(params))
}

export function getItem(name) {
  return JSON.parse(localStorage.getItem(name))
}

export function removeItem(name) {
  localStorage.removeItem(name)
}

export function inArray(name, arr) {
  return arr.indexOf(name)
}
